package com.zjj.learn.designmodel.pattern.factory.factory_method;

/**
 * *** @author zjj_admin
 * *** 2022/4/5 21:00
 */
public class CoffeeStore {
    private CoffeeFactory factory;

    public CoffeeStore(CoffeeFactory factory) {
        this.factory = factory;
    }

    public CoffeeStore() {
    }

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }

    public Coffee orderCoffee(){
        Coffee coffee = factory.createCoffee();
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
